using Microsoft.AspNetCore.Identity;
using Zack.DomainCommons.Models;

namespace Services.Identity.Domain.Entities;
public class User : IdentityUser<long>, IHasCreationTime, IHasDeletionTime, ISoftDelete
{
    public DateTime CreationTime { get; private set; }

    public DateTime? DeletionTime { get; private set; }
    public bool IsDeleted { get; private set; } = false;

    public void SoftDelete()
    {
        this.IsDeleted = true;
        this.DeletionTime = DateTime.Now;
    }
    public static User Create(string userName, string PhoneNumber)
    {
        return new User { UserName = userName, PhoneNumber = PhoneNumber, CreationTime = DateTime.Now };
    }
}